﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ipchange.aspx.cs" Inherits="Com.Rivyer.Web.ip.ipchange" %>

<%@ Register Assembly="DevExpress.Web.v11.2, Version=11.2.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>内容页模版</title>
    <link href="../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/rivcontent.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <%if (DesignMode)
      { %>
    <script type="text/javascript" src="../js/ASPxScriptIntelliSense.js"></script>
    <%} %>
    <script type="text/javascript">
        
    </script>
    <div>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td height="30">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td height="24" bgcolor="#353c44">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td width="6%" height="19" valign="bottom">
                                                        <div align="center">
                                                            <img src="../images/tb.gif" width="14" height="14" /></div>
                                                    </td>
                                                    <td width="94%" valign="bottom">
                                                        <span class="STYLE1">每个功能菜单项</span>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="font-size: 12px; width=100%">
                    <!--
                    <table cellpadding="0" cellspacing="15px" style="width: 630px; height: 550px">
                        <tr>
                            <td>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="10px" cellspacing="0" style="border: 1px solid #87adbf;vertical-align: top; text-align: center">
                        <tr>
                            <td>
                            $ ConnectionStrings:ITConnectionString
                            </td>
                        </tr>
                    </table>
                    内容页面
                    -->
                    <div id="rivcontent">
                        <div class="title">
                            IP地址增加与删除
                        </div>
                        <dx:ASPxGridView ID="ipoverviewgrid" runat="server" Font-Size="12px" AutoGenerateColumns="False"
                            DataSourceID="SqlDataSource1" KeyFieldName="id" Width="865px" 
                            ClientInstanceName="ipgridclient" onrowinserting="ipoverviewgrid_RowInserting">
                            <Columns>
                                <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0" Width="80px">
                                    <EditButton Text="修改">
                                    </EditButton>
                                    <NewButton Visible="True" Text="增加">
                                    </NewButton>
                                    <DeleteButton Text="删除" Visible="True">
                                    </DeleteButton>
                                    <CancelButton Text="取消">
                                    </CancelButton>
                                    <UpdateButton Text="新增">
                                    </UpdateButton>
                                    <ClearFilterButton Visible="True">
                                    </ClearFilterButton>
                                </dx:GridViewCommandColumn>
                                <dx:GridViewDataTextColumn FieldName="id" ReadOnly="True" Visible="False" VisibleIndex="1">
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn FieldName="ip" VisibleIndex="2" Width="95px">
                                    <EditFormSettings Visible="True" />
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="责任人" FieldName="usedperson" VisibleIndex="4"
                                    Width="90px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="部门" FieldName="department" VisibleIndex="6" Width="110px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataTextColumn Caption="单位" FieldName="organization" VisibleIndex="5"
                                    Width="90px">
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataCheckColumn Caption="外网" FieldName="usedinternet" VisibleIndex="7"
                                    Width="35px">
                                    <Settings AllowHeaderFilter="False" ShowFilterRowMenu="False" />
                                </dx:GridViewDataCheckColumn>
                                <dx:GridViewDataMemoColumn Caption="备注" FieldName="description" VisibleIndex="8"
                                    Width="120px">
                                </dx:GridViewDataMemoColumn>
                                <dx:GridViewDataTextColumn Caption="MAC" FieldName="macaddress" VisibleIndex="3"
                                    Width="100px">
                                    <PropertiesTextEdit NullText="MAC地址格式:**-**-**-**-**-**">
                                    </PropertiesTextEdit>
                                </dx:GridViewDataTextColumn>
                                <dx:GridViewDataDateColumn Caption="生产日期" FieldName="productdate" VisibleIndex="9"
                                    Width="65px">
                                    <PropertiesDateEdit DisplayFormatString="yyyy/MM">
                                    </PropertiesDateEdit>
                                </dx:GridViewDataDateColumn>
                                <dx:GridViewDataDateColumn Caption="修改日期" FieldName="modifydate" VisibleIndex="10"
                                    Width="80px">
                                    <PropertiesDateEdit DisplayFormatString="MM/dd hh:mm">
                                    </PropertiesDateEdit>
                                    <EditFormSettings Visible="False" />
                                </dx:GridViewDataDateColumn>
                            </Columns>
                            <SettingsBehavior ConfirmDelete="True" />
                            <SettingsPager PageSize="13">
                            </SettingsPager>
                            <SettingsEditing Mode="Inline" />
                            <Settings ShowFilterRow="True" ShowFilterRowMenu="True" ShowGroupPanel="True" />
                            <Styles>
                                <Header HorizontalAlign="Center">
                                </Header>
                            </Styles>
                        </dx:ASPxGridView>
                        <div class="editzone">
                            <table border="0" cellpadding="5px" cellspacing="0">
                                <tr>
                                    <td>
                                        <dx:ASPxButton ID="checkAll" runat="server" Text="全选" AutoPostBack="False">
                                            <ClientSideEvents Click="function(s, e) {
	ipgridclient.SelectAllRowsOnPage();
}" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="uncheckAll" runat="server" Text="不选" AutoPostBack="False">
                                            <ClientSideEvents Click="function(s, e) {
	ipgridclient.UnselectAllRowsOnPage();
}" />
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="deleteBatch" runat="server" Text="批量删除" 
                                            onclick="deleteBatch_Click">
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <asp:FileUpload ID="FileUpload1" runat="server" BorderStyle="Solid" 
                                            BorderWidth="1px" />
                                    </td>
                                    <td>
                                        <dx:ASPxButton ID="editBatch" runat="server" Text="批量导入" 
                                            onclick="editBatch_Click" >
                                        </dx:ASPxButton>
                                    </td>
                                    <td>
                                        <a href="./upload/ip批量增加修改模版.xls" style="font-size:12px">批量增加修改模版下载</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString='<%$ ConnectionStrings:ITConnectionString %>'
        DeleteCommand="DELETE FROM [tb_ipaddress] WHERE [id] = @id" InsertCommand="INSERT INTO [tb_ipaddress] ([ip], [usedperson], [department], [organization], [usedinternet], [description], [macaddress], [productdate], [modifydate]) VALUES (@ip, @usedperson, @department, @organization, @usedinternet, @description, @macaddress, @productdate, @modifydate)"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM [tb_ipaddress] ORDER BY [id]"
        UpdateCommand="UPDATE [tb_ipaddress] SET [ip] = @ip, [usedperson] = @usedperson, [department] = @department, [organization] = @organization, [usedinternet] = @usedinternet, [description] = @description, [macaddress] = @macaddress, [productdate] = @productdate, [modifydate] = @modifydate WHERE [id] = @id">
        <DeleteParameters>
            <asp:Parameter Name="id" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="ip" Type="String" />
            <asp:Parameter Name="usedperson" Type="String" />
            <asp:Parameter Name="department" Type="String" />
            <asp:Parameter Name="organization" Type="String" />
            <asp:Parameter Name="usedinternet" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="macaddress" Type="String" />
            <asp:Parameter DbType="Date" Name="productdate" />
            <asp:Parameter Name="modifydate" Type="DateTime" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="ip" Type="String" />
            <asp:Parameter Name="usedperson" Type="String" />
            <asp:Parameter Name="department" Type="String" />
            <asp:Parameter Name="organization" Type="String" />
            <asp:Parameter Name="usedinternet" Type="Int32" />
            <asp:Parameter Name="description" Type="String" />
            <asp:Parameter Name="macaddress" Type="String" />
            <asp:Parameter DbType="Date" Name="productdate" />
            <asp:Parameter Name="modifydate" Type="DateTime" />
            <asp:Parameter Name="id" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </form>
</body>
</html>
